import { Init, Provide } from '@midwayjs/decorator';
import { BaseService } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { UserFeedbackInfoEntity } from '../entity/info';

/**
 * userfeedback模块-用户反馈信息服务
 */
@Provide()
export class UserFeedbackInfoService extends BaseService {
  @InjectEntityModel(UserFeedbackInfoEntity)
  userFeedbackInfoEntity: Repository<UserFeedbackInfoEntity>;

  @Init()
  async init() {
    await super.init();
    this.setEntity(this.userFeedbackInfoEntity);
  }

  async page(param: any){
    console.log(param,'param')
    let name = param.keyWord ? ' where feedbackContent LIKE "%' + param.keyWord + '%" ' : ''
    console.log(name,'name')
    let result = this.sqlRenderPage("select * from userfeedback_info " + name + " ORDER BY id " + param.sort, param, false);
		// 你自己的业务逻辑
		return result;
  }

}
